﻿using RBAC.Domain;
using RBAC.Repository.Interfae;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RBAC.Repository.Impl
{
    public class RoleRepository : BaseRepository<Roles>, IRoleRepository
    {
        public RoleRepository(EFcoreContext context) : base(context)
        {
        }
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        public async Task<int> AddRole(Roles role)
        {
            return await base.AddAsync(role);
        }
        /// <summary>
        /// 显示角色列表
        /// </summary>
        /// <returns></returns>
        public async Task<List<Roles>> GetRoles()
        {
            return await base.GetAllAsync();
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<Roles> GetRoleValue(int id)
        {
            return await base.GetModelsAsync(id);
        }
    }
}
